package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReturnsTrueIfTheArrayIsInIncreasingOrder {
	public static boolean isOrdered(int[] array) {
		return isOrderedHelper(0, array);
	}

	private static boolean isOrderedHelper(int index, int[] array) {
		if (index > array.length - 2) {
			return true;
		} else if (array[index] > array[index + 1]) {
			return false;
		} else {
			return isOrderedHelper(index + 1, array);
		}
	}
}
